<%@ page import="edu.njfu.javawebdemo.dao.UserDao" %>
<%@ page import="edu.njfu.javawebdemo.model.User" %>
<%@ page import="edu.njfu.javawebdemo.util.Md5Util" %><%--
  Created by IntelliJ IDEA.
  User: guzhe
  Date: 2020/12/9
  Time: 11:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    //获取用户名和密码
String userName=request.getParameter("username");
String password=request.getParameter("password");
//保存
    User user=new User(userName, password);
// 根据保存的结果返回信息给用户
    UserDao userdao=new UserDao();
    boolean b = userdao.saveUser(user);
    if(b){
        response.sendRedirect("success.jsp");
    }else{
        response.sendRedirect("error.jsp");
    }
%>